package com.aplana.ccsd.model;

import org.apache.commons.lang.StringUtils;

import info.magnolia.module.templatingkit.dam.Asset;
import info.magnolia.module.templatingkit.dam.DAMException;

/**
 * 
 * Партнер
 * 
 */
public class Vendor {

	private final String text;
	private final Asset image;
	private final Asset menuImage;

	public Vendor(String text, Asset image, Asset menuImage) {
		super();
		this.text = text;
		this.image = image;
		this.menuImage = menuImage;
	}

	public String getText() {
		return text;
	}

	public Asset getImage() {
		return image;
	}

	public Asset getMenuImage() {
		return menuImage;
	}
	
	public boolean isHasContent() throws DAMException {
		return (!StringUtils.isBlank(getText())) || (getImage()!=null?(!StringUtils.isBlank(getImage().getLink())):false); 
	}

	@Override
	public String toString() {
		return "Vendor [text=" + text + ", image=" + image + "]";
	}

}
